﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;

namespace SmartMD.DataModel.Entity
{
    /** 
 * <p>类说明: 检查项目定义</p>
 * @version 1.0
 * <p>文件名： </p>
 * <p>创建人及时间： xiangyuliang 2011-8-27</p>
 * <p>修改人：</p>
 * <p>修改时间：</p>
 * <p>修改描述：</p>
 **/

    public class ExamItemInfo : BusinessEntity
    {
    //    private string _name;  //名称
   //     public string id { set; get; }    //标识
        private string _itemType;  //项目类型：检查项目，检验项目
        private string _storeTableName;  //存储表名
        private DateTime _lastModify;   //最后修改时间
        private string _sourceItemId;  //源检查项目标识
        private string _isEnabled;  //是否启用
        private string _description;   //描述

        private ObservableCollection<IndiceDefine> _columns;//指标列详细信息定义
        public ObservableCollection<IndiceDefine> columns
        {
            get
            {
                if (_columns == null)
                    _columns = new ObservableCollection<IndiceDefine>();
                return _columns;

            }
            set
            {
                _columns = value;
                OnPropertyChanged("Columns");
            }
        }
        public String ItemType
        {
            get
            {
                return _itemType;
            }
            set
            {
                _itemType = value;
                OnPropertyChanged(() => ItemType);
            }
        }
       
        public String StoreTableName
        {
            get
            {
                return _storeTableName;
            }
            set
            {
                _storeTableName = value;
                OnPropertyChanged(() => StoreTableName);
            }
        }
        [CheckValue("检查项目定义“最新修改时间”不能为空")]
        public DateTime LastModify
        {
            get
            {
                return _lastModify;
            }
            set
            {
                _lastModify = value;
                OnPropertyChanged(() => LastModify);
            }
        }
        [CheckValue("检查项目定义“源检查项目标识”不能为空")]
        public String SourceItemId
        {
            get
            {
                return _sourceItemId;
            }
            set
            {
                _sourceItemId = value;
                OnPropertyChanged(() => SourceItemId);
            }
        }
        public string IsEnabled
        {
            get
            {
                return _isEnabled;
            }
            set
            {
                _isEnabled = value;
                OnPropertyChanged(() => IsEnabled);
            }
        }
        
        public String Description
        {
            get
            {
                return _description;
            }
            set
            {
                _description = value;
                OnPropertyChanged(() => Description);
            }
        }
       
        public override void setValue(string key, Object value)
        {
            if (value is System.DBNull)
                return;
            switch (key.ToLower())
            {
                case "itemid":
                    this.Id = (string)value;
                    break;
                case "itemtype":
                    this.ItemType = value.ToString();
                    break;
                case "name":
                    this.Name = (string)value;
                    break;
                case "description":
                    this.Description = (string)value;
                    break;
                case "lastmodify":
                    this.LastModify = (DateTime)value;
                    break;
                case "sourceitemid":
                    this.SourceItemId = (string)value;
                    break;
                case "isenabled":
                    this.IsEnabled = value.ToString();
                    break;
                default:
                    break;
            }
        }

        private bool _isNew = false;
        public bool IsNew
        {
            get { return _isNew; }
            set
            {
                _isNew = value;
                OnPropertyChanged(() => IsNew);
            }
        }

    }
}
